<form id="edit-form" class="form-horizontal form-ajax" role="form" data-toggle="validator" method="POST" action="">
    <div class="form-group">
        <label for="cmd" class="control-label col-xs-12 col-sm-2">{:__('Cmd')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="text" class="form-control" id="cmd" name="row[cmd]" value="{$row.cmd}" data-rule="required;cmd" />
            <!-- <input type="hidden" class="form-control" id="type" name="row[type]" value="{$row.type}"/> -->
        </div>
    </div>

    <div class="form-group">
        <label for="type" class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
        <div class="col-xs-12 col-sm-8">
            {$groupList}
        </div>
    </div>

    {if condition="$row.type != 5"}
      <div class="form-group" id="content_url">
          <label for="content" class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
          <div class="col-xs-12 col-sm-8">
              <textarea class="form-control" id="content" name="row[content][]" rows="8" cols="80">{$row.content}</textarea>
          </div>
      </div>

        <div class="form-group row_url" id="row_url">
            <label for="c-local" class="control-label col-xs-12 col-sm-2">{:__('Upload')}:</label>
            <div class="col-xs-12 col-sm-8">
                <div class="input-group input-groupp-md ">
                    <a href="javascript:;"  id="plupload-local" class="btn btn-primary plupload btn-search-icon input-group-addon"  data-input-id="c-local" data-url="{:url('ajax/upload')}" style="background-color:#2c3e50;color:#fff">{:__("Upload to local")}</a>

                    <input type="text" name="row[url][]" value="{$row.url}" id="c-local" class="form-control"/>

                </div>
                <span class="n-msg">File Type :pdf,gif,zip,jpg,jpeg,png</span>
            </div>
        </div>
    {/if}
      <div class="content_list">
    {if condition="$row.type == 5"}
          <?php $row['content'] = json_decode($row['content'], true); ?>

          {foreach name="row['content']" item="item"}
            <div class="content-item">

                <div class="pull-right box-tools">
                    {if condition="$key != 0"}
                      <button type="button" class="btn btn-info btn-sm content-item-remove" data-widget="remove" data-toggle="tooltip" title="Remove" data-original-title="Remove">
                      <i class="fa fa-times"></i></button>
                    {/if}

                </div>

                <div class="form-group">
                    <label for="content" class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
                    <div class="col-xs-12 col-sm-8">
                        <textarea class="form-control" id="content-{$key}" name="row[content][]" rows="4" cols="80" data-rule="required;content[]" >{$item.note}</textarea>
                    </div>
                </div>

                <div class="form-group row_url" id="row_url">
                    <label for="c-local" class="control-label col-xs-12 col-sm-2">{:__('Upload')}:</label>
                    <div class="col-xs-12 col-sm-8">
                        <div class="input-group input-groupp-md ">
                            <a href="javascript:;" id="plupload-local-{$key}" class="btn btn-primary plupload btn-search-icon input-group-addon"  data-input-id="c-local-{$key}" data-url="{:url('ajax/upload')}" style="background-color:#2c3e50;color:#fff">{:__("Upload to local")}</a>
                            <input type="text" name="row[url][]" id="c-local-{$key}" class="form-control" data-rule="required;url[]" value="{$item.url}"/>
                        </div>
                    </div>
                </div>
            </div>
          {/foreach}






    {/if}


          </div>

    <div class="form-group row_add_content">
        <label for="row_add_content" class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-2">
            <button type="button" id="row_add_content" class="btn btn-primary"<i class="fa fa-add"></i> {:__("继续添加")}</button>
        </div>
    </div>


    <!-- <div class="form-group">
        <label for="c-local" class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button id="plupload-local" class="btn btn-primary plupload" data-input-id="c-local" data-url="{:url('ajax/upload')}"><i class="fa fa-upload"></i> {:__("Upload to local")}</button>
        </div>
    </div> -->

    <div class="form-group hidden layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>

<script id="content_list_tpl" type="text/html">

    <div class="content-item">
        <div class="pull-right box-tools">
            <button type="button" class="btn btn-info btn-sm content-item-remove" data-widget="remove" data-toggle="tooltip" title="Remove" data-original-title="Remove">
            <i class="fa fa-times"></i></button>
        </div>
        <div class="form-group">
            <label for="content" class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
            <div class="col-xs-12 col-sm-8">
                <textarea class="form-control" id="content-<%=count%>" name="row[content][]" rows="4" cols="80" data-rule="required;content[]" ></textarea>

            </div>
        </div>

        <div class="form-group row_url" id="row_url">
            <label for="c-local" class="control-label col-xs-12 col-sm-2">{:__('Upload')}:</label>
            <div class="col-xs-12 col-sm-8">
                <div class="input-group input-groupp-md ">
                    <a href="javascript:;" id="plupload-local-<%=count%>" class="btn btn-primary plupload btn-search-icon input-group-addon"  data-input-id="c-local-<%=count%>" data-url="{:url('ajax/upload')}" style="background-color:#2c3e50;color:#fff">{:__("Upload to local")}</a>
                    <input type="text" name="row[url][]" id="c-local-<%=count%>" class="form-control" data-rule="required;url[]"/>
                </div>
            </div>
        </div>
    </div>

</script>


<script id="content_list_putong_tpl" type="text/html">
    <div class="form-group">
        <label for="content" class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea class="form-control" id="content-<%=count%>" name="row[content][]" rows="4" cols="80" data-rule="required;content[]" ></textarea>

        </div>
    </div>
</script>

<script id="content_list_file_tpl" type="text/html">
    <div class="form-group">
        <label for="content" class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea class="form-control" id="content-<%=count%>" name="row[content][]" rows="4" cols="80" data-rule="required;content[]" ></textarea>

        </div>
    </div>

    <div class="form-group row_url" id="row_url">
        <label for="c-local" class="control-label col-xs-12 col-sm-2">{:__('Upload')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group input-groupp-md ">
                <a href="javascript:;" id="plupload-local-<%=count%>" class="btn btn-primary plupload btn-search-icon input-group-addon"  data-input-id="c-local-<%=count%>" data-url="{:url('ajax/upload')}" style="background-color:#2c3e50;color:#fff">{:__("Upload to local")}</a>
                <input type="text" name="row[url][]" id="c-local-<%=count%>" class="form-control" data-rule="required;url[]"/>
            </div>
        </div>
    </div>
</script>
